package xin.cymall;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.mybatis.spring.annotation.MapperScan;


@SpringBootApplication
//@EnableEurekaClient
@ComponentScan(basePackages = { "xin.cymall" })
// mapper 接口类扫描包配置
@MapperScan({ "xin.cymall.dao", "xin.fbmall.dao" })
public class Application {

	public static void main(String[] args) {
		ApplicationContext applicationContext = SpringApplication.run(Application.class, args);
		// String[] names = applicationContext.getBeanDefinitionNames();
		// 1.8 forEach循环
		// Arrays.asList(names).forEach(System.out::println);
		System.out.println("Server start succ");
	}

	@Bean
	public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
		 PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
		 c.setIgnoreUnresolvablePlaceholders(true);
		 return c;
	}

}
